﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;

namespace Managistics.Model.Mappings
{
    public class EmployeeMap : ClassMap<Employee>
    {

        public EmployeeMap()
        {
            Schema(Constants._tblSchema);
            Table(Constants._tblEmployee);
            LazyLoad();

            Id(x => x.Code).GeneratedBy.Assigned().Column("EMPLOYEEID");
            References(x => x.City).Column("CITYID");

            Map(x => x.Lastname).Column("LASTNAME").Not.Nullable().Length(30);
            Map(x => x.Firstname).Column("FIRSTNAME").Not.Nullable().Length(20);
            Map(x => x.Sex).Column("SEX").Not.Nullable();
            Map(x => x.MobileEmployees).Column("MOBILE_EMPLOYEES").Length(20);
            Map(x => x.EmailCompany).Column("EMAIL_COMPANY").Length(30);
            Map(x => x.OfficePhone).Column("OFFICE_PHONE").Length(20);
            Map(x => x.Status).Column("STATUS").Not.Nullable();
            Map(x => x.Positions).Column("POSITIONS").Length(20);
            Map(x => x.Department).Column("DEPARTMENT").Length(20);
            Map(x => x.DateHired).Column("DATE_HIRED").Not.Nullable();
        }
    }
}
